Set (SRCS 
    Main.cpp  ReadData.cpp  Util.cpp Math.cpp HandleExtendedDislocation.cpp
    WriteData.cpp Parse.cpp GenerateDislocation.cpp Fit.cpp
    ../custom/Custom.cpp)


AddDef(-DGSL "Link gsl library")


add_definitions(${compile_defs})
message("${Magenta}++ Compile definitions of ${PARADIS_EXE} are (${compile_defs})${ColourReset}")
add_executable(${PRODATA_EXE} ${SRCS})

target_include_directories(${PRODATA_EXE} PUBLIC ${PETSC_INCLUDES} ${HDF5_INCLUDE} ${GSL_INCLUDE} ../include ${MPI_INCLUDE_PATH})

target_compile_definitions(prodata PUBLIC PARALLEL=1 GSL)
#target_link_directories(prodata PUBLIC ${GSL_LINK_DIR})

target_link_libraries(${PRODATA_EXE} ${MPI_CXX_LIBRARIES} ${HDF5_LINK_FLAGS} ${GSL_LINK_FLAGS} ${PETSC_WITH_EXTERNAL_LIB}) # this must be  MPI_CXX_LIBRARIES for cpp file
set_target_properties(${PRODATA_EXE} PROPERTIES CXX_STANDARD 11 CXX_STANDARD_REQUIRED ON CXX_EXTENSIONS OFF)

Install(TARGETS ${PRODATA_EXE} RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)

message(STATUS "${BoldCyan}CMAKE_BUILD_TYPE = ${CMAKE_BUILD_TYPE}${ColourReset}")
message(STATUS "${BoldCyan}CMAKE_C_COMPILER = ${CMAKE_C_COMPILER}${ColourReset}")
message(STATUS "${BoldCyan}CMAKE_CXX_COMPILER = ${CMAKE_CXX_COMPILER}${ColourReset}")
message(STATUS "${BoldCyan}CMAKE_Fortran_COMPILER = ${CMAKE_Fortran_COMPILER}${ColourReset}")
message(STATUS "${BoldCyan}CMAKE_EXE_LINKER_FLAGS = ${CMAKE_EXE_LINKER_FLAGS}${ColourReset}")
message(STATUS "${BoldCyan}CMAKE_C_FLAGS = ${CMAKE_C_FLAGS}${ColourReset}")
message(STATUS "${BoldCyan}CMAKE_CXX_FLAGS = ${CMAKE_CXX_FLAGS}${ColourReset}")
message(STATUS "${BoldCyan}CMAKE_Fortran_FLAGS = ${CMAKE_Fortran_FLAGS}${ColourReset}")
